#ifndef __Computer_HH__
#define __Computer_HH__

#include <string.h>
#include <iostream>
using std::cout;
using std::endl;

//类名一般遵守大驼峰规则
class Computer
{
public:
    //成员函数命名遵循小驼峰规则
    void setBrand(const char * brand);//设置品牌

    void setPrice(double price);//设置价格

    void print(); //打印信息
private:
    //数据成员的名字前面加上下划线
    char _brand[20];
    double _price;
};

inline
void Computer::setBrand(const char * brand){
    strcpy(_brand,brand);
}

inline
void Computer::setPrice(double price){
    _price = price;
}

inline
void Computer::print(){
    cout << "brand:" << _brand << endl;
    cout << "price:" << _price << endl;
}




#endif
